<?php
declare (strict_types = 1);

namespace app\common\service;

/**
 * 第三方API服务类
 * Class ThirdPartyApiService
 * @package app\common\service
 */
class ThirdPartyApiService
{
    /**
     * 获取停车场数据
     *
     * @param string $parkCode 停车场编码
     * @return array
     */
    public function getParkingLotData(string $parkCode): array
    {
        // Mock data for development
        return [
            'code' => 200,
            'data' => [
                'park_code' => $parkCode,
                'park_name' => '示例停车场',
                'total_spaces' => 500,
                'occupied_spaces' => mt_rand(50, 400),
                'available_spaces' => 100,
                'utilization_rate' => 80.0
            ]
        ];
    }

    /**
     * 获取支付统计数据
     *
     * @return array
     */
    public function getPaymentStats(): array
    {
        // Mock data for development
        return [
            'code' => 200,
            'data' => [
                'today_revenue' => mt_rand(1000, 9000),
                'week_revenue' => mt_rand(10000, 50000),
                'month_revenue' => mt_rand(50000, 200000)
            ]
        ];
    }

    /**
     * 获取进出记录数据
     *
     * @return array
     */
    public function getEntryExitRecords(): array
    {
        // Mock data for development
        return [
            'code' => 200,
            'data' => [
                'today_entry' => mt_rand(100, 500),
                'today_exit' => mt_rand(80, 450),
                'current_vehicles' => mt_rand(20, 100),
                'records' => []
            ]
        ];
    }

    /**
     * 获取车位状态数据
     *
     * @param string $parkCode 停车场编码
     * @return array
     */
    public function getSpaceStatus(string $parkCode): array
    {
        // Mock data for development
        return [
            'code' => 200,
            'data' => [
                'park_code' => $parkCode,
                'areas' => [
                    [
                        'area_name' => 'A区',
                        'total' => 100,
                        'available' => mt_rand(10, 90)
                    ],
                    [
                        'area_name' => 'B区',
                        'total' => 150,
                        'available' => mt_rand(20, 130)
                    ],
                    [
                        'area_name' => 'C区',
                        'total' => 250,
                        'available' => mt_rand(30, 200)
                    ]
                ]
            ]
        ];
    }
} 